package com.bstek.bdf2.core.orm;

import com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceBuilder;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;

import javax.sql.DataSource;

/**
 * @Title: DataSourceConfig
 * @Package: com.bstek.bdf2.core.orm
 * @Description:
 * @Author: zxq
 * @Date: 2024/1/2 - 19:55
 */

@Configuration
public class DataSourceConfig {

    @Primary
    @Bean(name = "dataSourceOne")
    @ConfigurationProperties("spring.datasource.druid")
    public DataSource dataSourceOne(){
        return DruidDataSourceBuilder.create().build();
    }
}
